package com.example.demo.Data.Approval;

import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class Approval
{
    private long appr_id;
    private Date time;
    private long app_id;
    private int type;
    private boolean approval;
    private String comment;
    public static final int DEPARTMENT_MANAGER = 0;
    public static final int VICE_GENERAL_MANAGER = 1;
    public static final int GENERAL_MANAGER = 2;
    private static Set<Integer> availableType = new HashSet<Integer>()
    {
        {
            addAll(Arrays.asList(new Integer[]{DEPARTMENT_MANAGER, VICE_GENERAL_MANAGER, GENERAL_MANAGER}));
        }
    };
    protected Approval()
    {

    }

    public void setApp_id(long app_id)
    {
        this.app_id = app_id;
    }

    public void setAppr_id(long appr_id)
    {
        this.appr_id = appr_id;
    }

    public void setApproval(boolean approval)
    {
        this.approval = approval;
    }

    public void setComment(String comment)
    {
        this.comment = comment;
    }

    public void setTime(Date time)
    {
        this.time = time;
    }

    public void setType(int type)
    {
        if (availableType.contains(type))
        {
            this.type = type;
        }
    }
}
